/*
 * @Author: crissu 13750782397@163.com
 * @Date: 2024-05-30 01:38:00
 * @LastEditors: crissu 13750782397@163.com
 * @LastEditTime: 2024-06-03 02:07:58
 * @FilePath: /try_concurrence/Channels/tryChannels.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package channels

import "fmt"

func TryChannels() {
	intStream := make(chan int)

	go func() {
		defer close(intStream)
		for i := 1; i <= 5; i++ {
			intStream <- i
		}
	}()
	for integer := range intStream {
		fmt.Printf("%v ", integer)
	}
}
